home *** CD-ROM | disk | FTP | other *** search
/ WWW Studio 2004 / WWW Studio.iso / Serwisy / at40 / dane / attach / gra01.swf / scripts / frame_31 / DoAction.as
Encoding:
Text File  |  2004-04-02  |  10.1 KB  |  436 lines

  1. stop();
  2. pl._visible = 0;
  3. tabs = new Array(54,49,47,42,34,27,19,13,8,4,0);
  4. tabz = new Array(4,10,21,28,35,41,44,40,36,33,29,25,22,18,15,13,7,5);
  5. movieclip.prototype.grawitacja = function()
  6. {
  7.    updateAfterEvent();
  8.    g += 0.5;
  9.    if(_Y < 400)
  10.    {
  11.       proc2 = _Y / 400 * 100;
  12.    }
  13.    else
  14.    {
  15.       proc2 = 100;
  16.    }
  17.    if(_root.s.hitTest(_X,_Y,true) and skok == 0 and _X < _root.pr._x)
  18.    {
  19.       while(_root.s.hitTest(_X,_Y,true))
  20.       {
  21.          _Y = _Y - 0.15;
  22.       }
  23.       g = 0;
  24.       spadl == 0;
  25.    }
  26.    if(!_root.s.hitTest(_X,_Y,true) and _X < _root.pr._x and skok == 0)
  27.    {
  28.       xs += 0.2;
  29.       while(!_root.s.hitTest(_X,_Y,true))
  30.       {
  31.          updateAfterEvent();
  32.          _Y = _Y + 0.2;
  33.          g = 0;
  34.       }
  35.    }
  36.    if(_root.z.hitTest(_X,_Y,true) and _root.pr._x < _X)
  37.    {
  38.       while(_root.z.hitTest(_X,_Y,true))
  39.       {
  40.          _Y = _Y - 0.25;
  41.       }
  42.       g = 0;
  43.       zjazd = 1;
  44.       if(skok_ok == 0 and blok == 0)
  45.       {
  46.          blok = 1;
  47.          this.gotoAndPlay(12);
  48.       }
  49.       if(no == 0 and skok_ok == 1)
  50.       {
  51.          no = 1;
  52.          wynik = _X - _root.pr._x;
  53.          wart = wynik / 1070 * 100 * 3;
  54.          pom = String(wart);
  55.          _root.pl.wynik = pom.substring(0,5);
  56.          if(_root.max < wart)
  57.          {
  58.             _root.max = wart;
  59.          }
  60.          pom = String(_root.max);
  61.          _root.pl.max = pom.substring(0,5);
  62.       }
  63.       if(skok_ok == 0)
  64.       {
  65.          _root.pl.wynik = " :( ";
  66.          _root.pl.max = _root.max;
  67.       }
  68.       zz++;
  69.       if(60 < zz)
  70.       {
  71.          _root.pl._visible = 1;
  72.          zz = 0;
  73.       }
  74.    }
  75.    if(_root.pr2._x < _X)
  76.    {
  77.       xs *= 0.9;
  78.    }
  79.    if(!_root.z.hitTest(_X,_Y,true) and _root.pr._x < _X and zjazd == 1)
  80.    {
  81.       while(!_root.z.hitTest(_X,_Y,true))
  82.       {
  83.          updateAfterEvent();
  84.          _Y = _Y + 0.2;
  85.          g = 0;
  86.       }
  87.    }
  88.    if(_X < 400)
  89.    {
  90.       proc = _X / 400 * 100;
  91.    }
  92.    else
  93.    {
  94.       proc = 100;
  95.    }
  96.    if(_root.pr._x < _X and zjazd == 0)
  97.    {
  98.       xw = (- _root.ax) * (_root.wiatr / 10);
  99.       yw = _root.ay * (_root.wiatr / 10);
  100.       xw += wkat;
  101.       yw += - wkat;
  102.       xs += xw;
  103.       g += yw;
  104.    }
  105.    g_a = g * (1 - proc2 / 100);
  106.    xs_a = xs * (1 - proc / 100);
  107.    g_s = g * (proc2 / 100);
  108.    xs_s = xs * (proc / 100);
  109.    _X = _X + xs_a;
  110.    _Y = _Y + g_a;
  111.    _root.s._x -= xs_s;
  112.    _root.s._y -= g_s;
  113.    _root.z._x -= xs_s;
  114.    _root.z._y -= g_s;
  115.    _root.pr._x -= xs_s;
  116.    _root.pr._y -= g_s;
  117.    _root.pr2._x -= xs_s;
  118.    _root.pr2._y -= g_s;
  119.    _root.poz._y -= g_s;
  120.    i = 0;
  121.    while(i < _root.tabs.length)
  122.    {
  123.       _root["p" + _root.tabs[i]]._x -= xs_s;
  124.       _root["p" + _root.tabs[i]]._y -= g_s;
  125.       i++;
  126.    }
  127.    k = 0;
  128.    while(k < _root.tabz.length)
  129.    {
  130.       _root["pp" + _root.tabz[k]]._x -= xs_s;
  131.       _root["pp" + _root.tabz[k]]._y -= g_s;
  132.       k++;
  133.    }
  134.    if(_root.pr._x < _X and 0 < xs)
  135.    {
  136.       if(zjazd == 0)
  137.       {
  138.          xs -= 0.1;
  139.       }
  140.       else if(xs < 3)
  141.       {
  142.          xs -= 0.001;
  143.       }
  144.       spadl = 1;
  145.       if(zjazd == 1)
  146.       {
  147.          spadl = 0;
  148.       }
  149.    }
  150.    if(xs < 0)
  151.    {
  152.       xs = 0;
  153.    }
  154.    if(0.01 >= g and spadl == 0 and _root.pr._x < _X)
  155.    {
  156.       if(_root.poz._y < 500)
  157.       {
  158.          str *= 0.9;
  159.       }
  160.       else
  161.       {
  162.          str = 4 + xs / 2;
  163.       }
  164.       _Y = _Y + str * (1 - proc2 / 100);
  165.       _root.s._y -= str * (proc2 / 100);
  166.       _root.z._y -= str * (proc2 / 100);
  167.       _root.poz._y -= str * (proc2 / 100);
  168.    }
  169.    if(spadl == 0)
  170.    {
  171.       if(_root.p54._x < _X and _X < _root.p49._x)
  172.       {
  173.          _rotation = 54;
  174.       }
  175.       else if(_root.p49._x < _X and _X < _root.p47._x)
  176.       {
  177.          _rotation = 49;
  178.       }
  179.       else if(_root.p47._x < _X and _X < _root.p42._x)
  180.       {
  181.          _rotation = 47;
  182.       }
  183.       else if(_root.p42._x < _X and _X < _root.p34._x)
  184.       {
  185.          _rotation = 42;
  186.       }
  187.       else if(_root.p34._x < _X and _X < _root.p27._x)
  188.       {
  189.          _rotation = 34;
  190.       }
  191.       else if(_root.p27._x < _X and _X < _root.p19._x)
  192.       {
  193.          _rotation = 27;
  194.       }
  195.       else if(_root.p19._x < _X and _X < _root.p13._x)
  196.       {
  197.          _rotation = 19;
  198.       }
  199.       else if(_root.p13._x < _X and _X < _root.p8._x)
  200.       {
  201.          _rotation = 13;
  202.       }
  203.       else if(_root.p8._x < _X and _X < _root.p4._x)
  204.       {
  205.          _rotation = 8;
  206.       }
  207.       else if(_root.p4._x < _X and _X < _root.p0._x)
  208.       {
  209.          _rotation = 4;
  210.       }
  211.       else if(_root.p0._x < _X and _X < _root.pp4._x)
  212.       {
  213.          _rotation = 0;
  214.       }
  215.       else if(_root.pp4._x < _X and _X < _root.pp14._x)
  216.       {
  217.          _rotation = 4;
  218.       }
  219.       else if(_root.pp14._x < _X and _X < _root.pp21._x)
  220.       {
  221.          _rotation = 14;
  222.       }
  223.       else if(_root.pp21._x < _X and _X < _root.pp28._x)
  224.       {
  225.          _rotation = 21;
  226.       }
  227.       else if(_root.pp28._x < _X and _X < _root.pp35._x)
  228.       {
  229.          _rotation = 28;
  230.       }
  231.       else if(_root.pp35._x < _X and _X < _root.pp41._x)
  232.       {
  233.          _rotation = 35;
  234.       }
  235.       else if(_root.pp41._x < _X and _X < _root.pp44._x)
  236.       {
  237.          _rotation = 41;
  238.       }
  239.       else if(_root.pp44._x < _X and _X < _root.pp40._x)
  240.       {
  241.          _rotation = 44;
  242.       }
  243.       else if(_root.pp40._x < _X and _X < _root.pp36._x)
  244.       {
  245.          _rotation = 40;
  246.       }
  247.       else if(_root.pp36._x < _X and _X < _root.pp33._x)
  248.       {
  249.          _rotation = 36;
  250.       }
  251.       else if(_root.pp33._x < _X and _X < _root.pp29._x)
  252.       {
  253.          _rotation = 33;
  254.       }
  255.       else if(_root.pp29._x < _X and _X < _root.pp25._x)
  256.       {
  257.          _rotation = 29;
  258.       }
  259.       else if(_root.pp25._x < _X and _X < _root.pp22._x)
  260.       {
  261.          _rotation = 25;
  262.       }
  263.       else if(_root.pp22._x < _X and _X < _root.pp18._x)
  264.       {
  265.          _rotation = 22;
  266.       }
  267.       else if(_root.pp18._x < _X and _X < _root.pp15._x)
  268.       {
  269.          _rotation = 18;
  270.       }
  271.       else if(_root.pp15._x < _X and _X < _root.pp13._x)
  272.       {
  273.          _rotation = 15;
  274.       }
  275.       else if(_root.pp13._x < _X and _X < _root.pp7._x)
  276.       {
  277.          _rotation = 13;
  278.       }
  279.       else if(_root.pp7._x < _X and _X < _root.pp5._x)
  280.       {
  281.          _rotation = 7;
  282.       }
  283.       else if(_root.pp5._x < _X and _X < _root.pp3._x)
  284.       {
  285.          _rotation = 5;
  286.       }
  287.    }
  288.    if(_root.p54._x < _X and _X < _root.p49._x)
  289.    {
  290.       _root.cien._rotation = 54;
  291.    }
  292.    else if(_root.p49._x < _X and _X < _root.p47._x)
  293.    {
  294.       _root.cien._rotation = 49;
  295.    }
  296.    else if(_root.p47._x < _X and _X < _root.p42._x)
  297.    {
  298.       _root.cien._rotation = 47;
  299.    }
  300.    else if(_root.p42._x < _X and _X < _root.p34._x)
  301.    {
  302.       _root.cien._rotation = 42;
  303.    }
  304.    else if(_root.p34._x < _X and _X < _root.p27._x)
  305.    {
  306.       _root.cien._rotation = 34;
  307.    }
  308.    else if(_root.p27._x < _X and _X < _root.p19._x)
  309.    {
  310.       _root.cien._rotation = 27;
  311.    }
  312.    else if(_root.p19._x < _X and _X < _root.p13._x)
  313.    {
  314.       _root.cien._rotation = 19;
  315.    }
  316.    else if(_root.p13._x < _X and _X < _root.p8._x)
  317.    {
  318.       _root.cien._rotation = 13;
  319.    }
  320.    else if(_root.p8._x < _X and _X < _root.p4._x)
  321.    {
  322.       _root.cien._rotation = 8;
  323.    }
  324.    else if(_root.p4._x < _X and _X < _root.p0._x)
  325.    {
  326.       _root.cien._rotation = 4;
  327.    }
  328.    else if(_root.p0._x < _X and _X < _root.pp4._x)
  329.    {
  330.       _root.cien._rotation = 0;
  331.    }
  332.    else if(_root.pp4._x < _X and _X < _root.pp14._x)
  333.    {
  334.       _root.cien._rotation = 4;
  335.    }
  336.    else if(_root.pp14._x < _X and _X < _root.pp21._x)
  337.    {
  338.       _root.cien._rotation = 14;
  339.    }
  340.    else if(_root.pp21._x < _X and _X < _root.pp28._x)
  341.    {
  342.       _root.cien._rotation = 21;
  343.    }
  344.    else if(_root.pp28._x < _X and _X < _root.pp35._x)
  345.    {
  346.       _root.cien._rotation = 28;
  347.    }
  348.    else if(_root.pp35._x < _X and _X < _root.pp41._x)
  349.    {
  350.       _root.cien._rotation = 35;
  351.    }
  352.    else if(_root.pp41._x < _X and _X < _root.pp44._x)
  353.    {
  354.       _root.cien._rotation = 41;
  355.    }
  356.    else if(_root.pp44._x < _X and _X < _root.pp40._x)
  357.    {
  358.       _root.cien._rotation = 44;
  359.    }
  360.    else if(_root.pp40._x < _X and _X < _root.pp36._x)
  361.    {
  362.       _root.cien._rotation = 40;
  363.    }
  364.    else if(_root.pp36._x < _X and _X < _root.pp33._x)
  365.    {
  366.       _root.cien._rotation = 36;
  367.    }
  368.    else if(_root.pp33._x < _X and _X < _root.pp29._x)
  369.    {
  370.       _root.cien._rotation = 33;
  371.    }
  372.    else if(_root.pp29._x < _X and _X < _root.pp25._x)
  373.    {
  374.       _root.cien._rotation = 29;
  375.    }
  376.    else if(_root.pp25._x < _X and _X < _root.pp22._x)
  377.    {
  378.       _root.cien._rotation = 25;
  379.    }
  380.    else if(_root.pp22._x < _X and _X < _root.pp18._x)
  381.    {
  382.       _root.cien._rotation = 22;
  383.    }
  384.    else if(_root.pp18._x < _X and _X < _root.pp15._x)
  385.    {
  386.       _root.cien._rotation = 18;
  387.    }
  388.    else if(_root.pp15._x < _X and _X < _root.pp13._x)
  389.    {
  390.       _root.cien._rotation = 15;
  391.    }
  392.    else if(_root.pp13._x < _X and _X < _root.pp7._x)
  393.    {
  394.       _root.cien._rotation = 13;
  395.    }
  396.    else if(_root.pp7._x < _X and _X < _root.pp5._x)
  397.    {
  398.       _root.cien._rotation = 7;
  399.    }
  400.    else if(_root.pp5._x < _X and _X < _root.pp3._x)
  401.    {
  402.       _root.cien._rotation = 5;
  403.    }
  404.    while(!_root.s.hitTest(_root.cien._x,_root.cien._y,true) and _root.cien._x < _root.pr._x)
  405.    {
  406.       updateAfterEvent();
  407.       _root.cien._y += 0.2;
  408.    }
  409.    while(!_root.z.hitTest(_root.cien._x,_root.cien._y,true) and _root.cien._x >= _root.pr._x)
  410.    {
  411.       updateAfterEvent();
  412.       _root.cien._y += 0.2;
  413.    }
  414.    while(_root.z.hitTest(_root.cien._x,_root.cien._y,true))
  415.    {
  416.       updateAfterEvent();
  417.       _root.cien._y -= 0.2;
  418.    }
  419.    if(xold != _root.s._x or yold != _root.s._y)
  420.    {
  421.       xx = xold - _root.s._x;
  422.       yy = yold - _root.s._y;
  423.       _root.sk1._x -= xx;
  424.       _root.sk1._y -= yy;
  425.       _root.sk2._x -= xx;
  426.       _root.sk2._y -= yy;
  427.       _root.sk3._x -= xx;
  428.       _root.sk3._y -= yy;
  429.       _root.tlo._x -= xx / 10;
  430.       _root.tlo._y -= yy / 10;
  431.       xold = _root.s._x;
  432.       yold = _root.s._y;
  433.    }
  434.    _root.cien._x += xs_a;
  435. };
  436.